/**
 * Модуль формы заявки + Bitrix24
 * Стили адаптированы под дизайн-систему сайта
 */

.lead-form-stack{
  position: relative;
}

.lead-form{
  display: grid;
  gap: 12px;
  text-align: left;
}

.lead-form label{
  display: grid;
  gap: 8px;
}

.lead-form label:not(.lead-form__agreement) > span{
  display: inline-flex;
  align-items: flex-start;
  align-self: flex-start;
  width: auto;
  max-width: 100%;
  font-size: 12px;
  color: rgba(255,255,255,.78);
}

.lead-form .label-required{
  position: static;
  font-size: 0.78em;
  line-height: 1.2;
  color: var(--accent, #a855f7);
  font-weight: 600;
  margin-left: 0.12em;
  vertical-align: super;
}

.lead-form input,
.lead-form textarea{
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(11,11,15,.85);
  padding: 12px 12px;
  outline: none;
  font-size: inherit;
  color: inherit;
}

.lead-form input:focus,
.lead-form textarea:focus{
  border-color: rgba(255,255,255,.16);
  box-shadow: 0 0 0 4px rgba(255,255,255,.07);
}

.lead-form textarea{
  resize: vertical;
  min-height: 110px;
}

.lead-form textarea::placeholder{
  font-size: 12px;
  color: rgba(255,255,255,.42);
}

/* Согласие */
.lead-form__agreement{
  display: flex !important;
  align-items: flex-start;
  gap: 10px;
  margin-top: 2px;
}

.lead-form__agreement > input{
  width: 16px !important;
  min-height: 16px !important;
  height: 16px !important;
  margin-top: 2px;
  padding: 0 !important;
  flex: 0 0 16px;
  accent-color: var(--accent);
  background: transparent;
  border: 1px solid rgba(255,255,255,.08);
}

.lead-form__agreement > span{
  display: block;
  flex: 1;
  min-width: 0;
  font-size: 11px;
  line-height: 1.35;
  color: rgba(255,255,255,.58);
}

.lead-form__agreement a{
  color: rgba(255,255,255,.78);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Тело формы и кнопка */
.lead-form__body{
  display: grid;
  gap: 12px;
}

.lead-form__submit{
  position: relative;
  min-height: 48px;
}

.lead-form__btn-text,
.lead-form__btn-spinner{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 13px;
  color: #000;
}

.lead-form__btn-spinner[hidden],
.lead-form__btn-text[hidden]{
  display: none !important;
}

.lead-form__spinner{
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,.28);
  border-top-color: #000;
  animation: lead-form-spin 0.7s linear infinite;
  flex: 0 0 18px;
}

@keyframes lead-form-spin {
  to {
    transform: rotate(360deg);
  }
}

.lead-form.is-sending .lead-form__submit{
  pointer-events: none;
  opacity: 0.92;
}

/* Результат */
.lead-form__result{
  display: grid;
  gap: 16px;
  padding: 8px 0 4px;
  text-align: center;
  animation: lead-form-result-in 0.35s ease;
}

.lead-form__result[hidden],
.lead-form__body[hidden]{
  display: none !important;
}

.lead-form__result-text{
  margin: 0;
  font-size: 16px;
  line-height: 1.45;
  color: var(--accent2, #a855f7);
  font-weight: 600;
}

.lead-form.is-error .lead-form__result-text{
  color: #ff9aa3;
}

@keyframes lead-form-result-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Скрытый мост Битрикс24 */
.lead-form__b24-bridge{
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
